﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.IO;

namespace inohigo
{
	public class Lexer
	{
		public Lexer() { }

		public List<Token> Analyze( string input )
		{
			List<Token> tokenList = new List<Token>();
			//			List<Char> buffer = new List<char>();
			Token token;

			StringReader reader = new StringReader( input );

			CharEnumerator cEnum = input.GetEnumerator();
			while( cEnum.MoveNext() )
			{
				char tmp = cEnum.Current;
				token = new Token();
				token.Value = tmp;
				token.TokenType = Token.GetTokenType( tmp );

				tokenList.Add( token );
			}

			return tokenList;
		}
	}
}
